<%--
  Created by IntelliJ IDEA.
  User: luren
  Date: 2021/9/8
  Time: 8:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>搜索结果</title>
    <script src="js/jquery-3.5.1.min.js"></script>
    <script src="js/result.js"></script>
    <script>
        $(document).ready(function () {
            let args = GetUrlParms();
            let kw = args['kw'];
            if (kw !== undefined) {
                $.ajax({
                    url:'findProduct.do',
                    data:'keyWord='+ kw,
                    type:'post',
                    // dataType:'json',
                    success:function (request) {
                        if (request !== null) {
                            $('#product-list').html(request);
                        } else {
                            $('#product-list').html('未查找到商品');
                        }
                    },
                    error:function (errorInfo) {

                        $('#product-list').html('未查找到商品');

                    }
                })
            }
        });
    </script>
</head>
<body>
<header>
    <label for="search"></label><input type="text" id="search">
    <input type="button" value="搜索">
</header>


<main id="product-list">

</main>

</body>
</html>
